import java.util.Properties;
public class LeilaoFactory{


	public static ILeilao getInstance (String descricao, IUsuario vendedor, double valor) throws Exception{
	
		//ILeilao leilao = new Leilao("leilao de um aviao", 20,vendedor);
		//ILeilao leilao = new LeilaoReverso("leilao de um aviao", 20);
		ILeilao leilao = getILeilaoInstance();
		leilao.setDescricao(descricao);
		leilao.setVendedor(vendedor);
		leilao.setValor(valor);
		return leilao ;
	}

	public static ILeilao getILeilaoInstance() throws Exception{
		Properties properties = HandlerProperties.loadProperties("options.properties");

		ClassLoader classLoader = Main.class.getClassLoader();
		Class aClass = classLoader.loadClass(properties.getProperty("classe"));
		return (ILeilao) aClass.newInstance();
	}
}